from django.db import models

# Create your models here.
from mlh.utils.models import BaseModel
from users.models import User


class Experience(BaseModel):
    user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="用户id",related_name="experiences",null=True)
    # 外键字段会自动加上id，例：user_id
    u_company = models.CharField(max_length=32, verbose_name="工作公司", null=True)
    u_city = models.CharField(max_length=32, verbose_name="工作城市", null=True)
    position = models.CharField(max_length=32, verbose_name="职位", null=True)
    s_time = models.CharField(max_length=32, verbose_name="工作开始时间", null=True)
    e_time = models.CharField(max_length=32, verbose_name="工作结束时间", null=True)
    u_skills = models.TextField(verbose_name="工作技能", null=True)
    desc = models.TextField(verbose_name="工作成就", null=True)

    class Meta:
        db_table = "tb_story"
        verbose_name = "用户经历表"
        verbose_name_plural = verbose_name

    def __str__(self):
        return "%s:%s" % (self.user_id, self.id)
